<template>
    <div class="myHeader">
        <div>
            <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
                <van-swipe-item v-for="(item,index) in bannerList" :key="index">
                    <img :src="item.banner_img" />
                </van-swipe-item>
            </van-swipe>
        </div>
        <div class="nav">
            <ul>
                <li @click="$router.push('/course')">
                    <i class="iconfont icon-shu_"></i>
                    <p>特色课</p>
                </li>
                <li>
                    <i class="iconfont icon-xiaoxi"></i>
                    <p>一对一辅导</p>
                </li>
                <li>
                    <i class="iconfont icon-yingshi-xianxing2-1"></i>
                    <p>学习日历</p>
                </li>
            </ul>
        </div>
    </div>
</template>

<script>
import { Swipe, SwipeItem } from "vant";
import { banner } from "../../../request/http.js";
export default {
  data() {
    return {
      bannerList: [] // 轮播图数据
    };
  },
  created() {
    // 轮播图请求
    banner().then(res => {
      console.log(res);
      this.bannerList = res;
    });
  },
  components: {
    [Swipe.name]: Swipe,
    [SwipeItem.name]: SwipeItem
  }
};
</script>

<style lang="scss" scoped>
.myHeader{
    position: relative;
}
.my-swipe {
  height: 224px;
  img {
    width: 100%;
  }
}
.nav {
  height: 206px;
  background: #f5f5f5;
  display: flex;
  justify-content: center;
  ul{
    width: 674px;
    height: 103px;
    display: flex;
    justify-content: space-between;
    position: absolute;
    bottom: 150px;
    li{
        width: 206px;
        height: 206px;
        border-radius: 15px;
        text-align: center;
        background-color: #fff;
        font-size: 25px;
        padding-top: 30px;
        p{
            margin-top: 20px;
        }
        .iconfont{
            font-weight: 600;
            font-size: 60px;
        }
        .icon-shu_{
            color: #5251da;
        }
        .icon-xiaoxi{
            color: #72c08c;
        }
        .icon-yingshi-xianxing2-1{
            color: #c88d7f;
        }
    }
  }
}
</style>


